import { Injectable } from '@nestjs/common'
import { ConfigService } from '@nestjs/config'
import {
  CasbinModuleOptions,
  CasbinModuleOptionsFactory
} from '@ttou/nest-casbin'

@Injectable()
export class CasbinOptionsService implements CasbinModuleOptionsFactory {
  constructor(private configService: ConfigService) {}

  createCasbinModuleOptions(): CasbinModuleOptions {
    return this.configService.get('casbin')
  }
}
